package com.jixi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jixi.mapper.TeacherMapper;
import com.jixi.pojo.entity.Teacher;
import com.jixi.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> implements TeacherService {
    
    @Autowired
    private TeacherMapper teacherMapper;
    
    /**
     * 统计班主任数量
     *
     * @return 班主任数量
     */
    @Override
    public Long countTeacherNum() {
        LambdaQueryWrapper<Teacher> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Teacher::getIsDeleted, 0);
        return teacherMapper.selectCount(queryWrapper);
    }
}
